VERSION 4.00 Begin VB.Form frmMenu BorderStyle = 1 'Fixed Single Caption = "Menu Items With Pictures And Words" ClientHeight = 2520 ClientLeft = 1305 ClientTop = 1860 ClientWidth = 6690 Height = 3210 Left = 1245 LinkTopic = "Form1" MaxButton = 0 'False ScaleHeight = 2520 ScaleWidth = 6690 Top = 1230 Width = 6810 Begin ComctlLib.ImageList img Left = 240 Top = 240 _ExtentX = 1005 _ExtentY = 1005 BackColor = 16777215 ImageWidth = 13 ImageHeight = 13 MaskColor = 16777215 _Version = 327682 BeginProperty Images {0713E8C2-850A-101B-AFC0-4210102A8DA7} NumListImages = 5 BeginProperty ListImage1 {0713E8C3-850A-101B-AFC0-4210102A8DA7} Picture = "frmMenu.frx":0000 Key = "" EndProperty BeginProperty ListImage2 {0713E8C3-850A-101B-AFC0-4210102A8DA7} Picture = "frmMenu.frx":00FA Key = "" EndProperty BeginProperty ListImage3 {0713E8C3-850A-101B-AFC0-4210102A8DA7} Picture = "frmMenu.frx":01F4 Key = "" EndProperty BeginProperty ListImage4 {0713E8C3-850A-101B-AFC0-4210102A8DA7} Picture = "frmMenu.frx":02EE Key = "" EndProperty BeginProperty ListImage5 {0713E8C3-850A-101B-AFC0-4210102A8DA7} Picture = "frmMenu.frx":03E8 Key = "" EndProperty EndProperty End Begin VB.Menu mnuFile Caption = "&File" Begin VB.Menu mnuOpen Caption = "&Open" End Begin VB.Menu mnuDesign Caption = "&Design" End Begin VB.Menu mnuDelete Caption = "D&elete" End Begin VB.Menu mnuProperties Caption = "&Properties" End Begin VB.Menu mnuSep1 Caption = "-" End Begin VB.Menu mnuTest Caption = "&Test" End End Begin VB.Menu mnuHelp Caption = "&Help" Begin VB.Menu mnuHelpTopics Caption = "&Help Topics" End Begin VB.Menu mnuSep2 Caption = "-" End Begin VB.Menu mnuAbout Caption = "&About" End End Attribute VB_Name = "frmMenu" Attribute VB_Creatable = False Attribute VB_Exposed = False Option Explicit Private Declare Function GetMenu Lib "user32" (ByVal hwnd As Long) As Long Private Declare Function GetSubMenu Lib "user32" (ByVal hMenu As Long, ByVal nPos As Long) As Long Private Declare Function GetMenuItemID Lib "user32" (ByVal hMenu As Long, ByVal nPos As Long) As Long Private Declare Function ModifyMenu Lib "user32" Alias "ModifyMenuA" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long, ByVal wIDNewItem As Long, ByVal lpString As String) As Long Private Declare Function SetMenuItemBitmaps Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long, ByVal hBitmapUnchecked As Long, ByVal hBitmapChecked As Long) As Long Private Declare Function GetMenuCheckMarkDimensions Lib "user32" () As Long Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long Private Declare Function CreateCompatibleDC Lib "gdi32" (ByVal hdc As Long) As Long Private Declare Function CreateCompatibleBitmap Lib "gdi32" (ByVal hdc As Long, ByVal nWidth As Long, ByVal nHeight As Long) As Long Private Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long Private Declare Function CreateBitmap Lib "gdi32" (ByVal nWidth As Long, ByVal nHeight As Long, ByVal nPlanes As Long, ByVal nBitCount As Long, lpBits As Any) As Long Private Declare Function GetDesktopWindow Lib "user32" () As Long Private Declare Function PatBlt Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal dwRop As Long) As Long Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long Private Sub Form_Load() Dim i% Dim hMenu, hSubMenu, menuID, x hMenu = GetMenu(hwnd) hSubMenu = GetSubMenu(hMenu, 0) '1 for "Other" menu etcetera For i = 1 To 4 menuID = GetMenuItemID(hSubMenu, i - 1) x = SetMenuItemBitmaps(hMenu, menuID, &H4, img.ListImages(i).Picture, img.ListImages(i).Picture) Next menuID = GetMenuItemID(hSubMenu, 5) x = SetMenuItemBitmaps(hMenu, menuID, 0, img.ListImages(5).Picture, 0&) End Sub Private Sub Form_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single) If Button = 2 Then PopupMenu mnuFile, 2, x End If End Sub